package leetcode_数与位._01数字的位操作;

/**
 * @author yzh
 * @data 2021/3/22 21:10
 * 回文数
 */
public class _09_回文数 {
    public static void main(String[] args) {
        System.out.println(new _09_回文数().isPalindrome(122));
    }

    public boolean isPalindrome(int x) {
        if (x < 0) return false;
        int res = 0, tem = x;
        while (x != 0) {
            res = res * 10 + x % 10;
            x /= 10;
        }
        return res == tem;
    }
}
